package com.gec.util;

import com.gec.component.HttpServlet;
import com.gec.component.WebContainer;

public class ContainerTest {

    public static void test1()
            throws Exception {
        WebContainer c = new WebContainer();
        System.out.println("{1}找一个有注册的Servlet");
        HttpServlet servlet = c.findServlet("/Login");
        System.out.println(servlet);

        System.out.println("{2}找一个有注册的Servlet");
        servlet = c.findServlet("/Login");
        System.out.println(servlet);

        System.out.println("找一个没有注册的Servlet");
        servlet = c.findServlet("/Fruit");
        System.out.println(servlet);
    }

    public static void test2()
            throws Exception {
        WebContainer c = new WebContainer();
        c.callDefaultServlet(
                "/login.htm", null, null);
    }

    public static void main(String[] args)
            throws Exception {
        WebContainer c = new WebContainer();
        c.startServer(8080);
    }

}
